var speed = 6; var shipMc = this.attachMovie("ship1", "ship1", 10000); shipMc._y = Stage.height-(shipMc._height+10); shipMc._x = Stage.width/2 - (shipMc._width/2) ; function moveShip() { if (Key.isDown(Key.UP)) { shipMc._y -= speed; } if (Key.isDown(Key.DOWN)) { shipMc._y += speed; } if (Key.isDown(Key.LEFT)) { shipMc._x -= speed; } if (Key.isDown(Key.RIGHT)) { shipMc._x += speed; } } this.onEnterFrame = function(){ moveShip(); };